home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / mntdoc01.zoo / mintdoc / cat2 / pvfork.nr < prev    next >
Encoding:
Text File  |  1993-03-03  |  1.6 KB  |  67 lines

  1.  
  2.  
  3.  
  4. Pvfork(2)                  Oct. 1, 1991                 Pvfork(2)
  5.  
  6.  
  7. N✓NA✓AM✓ME✓E
  8.        Pvfork - create a copy of the current process
  9.  
  10. S✓SY✓YN✓NO✓OP✓PS✓SI✓IS✓S
  11.        WORD Pvfork();
  12.  
  13. D✓DE✓ES✓SC✓CR✓RI✓IP✓PT✓TI✓IO✓ON✓N
  14.        _✓P_✓v_✓f_✓o_✓r_✓k  creates  a  copy  of the current process. Both the
  15.        child (the new process created) and the parent  (the  pro-
  16.        cess  which  first  made  the call) share the same address
  17.        space, i.e. any changes that the child makes to  variables
  18.        will  also  be  noticed  by  the  parent.  The new process
  19.        begins execution with an apparent return from  the  _✓P_✓v_✓f_✓o_✓r_✓k
  20.        call.
  21.  
  22.        Because  the  two  processes share the same address space,
  23.        including the same stack, there could be many problems  if
  24.        they  actually  were  running at the same time. Therefore,
  25.        the parent process is suspended until  the  child  process
  26.        either  exits  or uses mode 200 of _✓P_✓e_✓x_✓e_✓c to overlay itself
  27.        with a new program in a new address space.
  28.  
  29. R✓RE✓ET✓TU✓UR✓RN✓NS✓S
  30.        0 in the child
  31.  
  32.        The new process id (a positive number), in the parent.
  33.  
  34.        ENSMEM if there is not enough memory  to  create  the  new
  35.        process.
  36.  
  37. S✓SE✓EE✓E A✓AL✓LS✓SO✓O
  38.        _✓P_✓e_✓x_✓e_✓c(2), _✓P_✓f_✓o_✓r_✓k(2)
  39.  
  40. B✓BU✓UG✓GS✓S
  41.        If  the  parent  is  in  supervisor mode when this call is
  42.        made, the child will be started in user mode anyway; thus,
  43.        it  is  strongly  recommended  that this call be made only
  44.        from user mode.
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64. Version 0.9          MiNT Programmer's Manual                   1
  65.  
  66.  
  67.